Skip to content

Conversation

@jrandolf-google
Copy link
Contributor

@jrandolf-google jrandolf-google commented Feb 20, 2024

We enforce default pointer properties although the WebDriver spec does not specify any.


Preview | Diff

@OrKoN
Copy link
Contributor

OrKoN commented Feb 20, 2024

@jrandolf is it in the spec that the properties can be inferred? (could you please add a link)

@jrandolf-google jrandolf-google deleted the jrandolf/defaults branch February 20, 2024 13:53
@jrandolf-google jrandolf-google restored the jrandolf/defaults branch February 20, 2024 13:55
@jrandolf-google
Copy link
Contributor Author

@jrandolf is it in the spec that the properties can be inferred? (could you please add a link)

This is implementation-defined. See https://www.w3.org/TR/webdriver2/#dfn-dispatch-a-pointerdown-action

@OrKoN OrKoN changed the title chore: remove pointer defaults Remove pointer events defaults Feb 20, 2024
@jrandolf-google jrandolf-google changed the title Remove pointer events defaults Remove pointer event defaults Feb 20, 2024
Copy link
Contributor

@OrKoN OrKoN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (as the classic spec does not require actual default values). @juliandescottes @jgraham PTAL

@jgraham
Copy link
Member

jgraham commented Feb 26, 2024

The defaults match the defaults if you construct an event in the DOM API, per: https://www.w3.org/TR/pointerevents/#pointer-events-and-interfaces. I think that's what's intended by classic, and saying "this is just implementation defined" is not OK (authors should be able to depend on event properties being consistent between browsers for a given input).

@jrandolf-google
Copy link
Contributor Author

https://www.w3.org/TR/pointerevents/#pointer-events-and-interfaces

The defaults don't really make sense for a lot of events. For example, for pointer, the default pressure is always 0.5 (try it on any browser)

@jgraham
Copy link
Member

jgraham commented Feb 26, 2024

That seems like a reason to update those specs, rather than a reason to throw our hands up and say "implementation defined".

@jrandolf-google
Copy link
Contributor Author

jrandolf-google commented Feb 26, 2024

https://www.w3.org/TR/pointerevents/#pointer-events-and-interfaces

PointerEventInit is used for custom events built from the DOM. It does not reflect what is expected from the automation side. We could take your arguments and apply them to keyboard events and etc, but this wouldn't benefit an automation user. In particular, keyboard events, e.g., allow setting the ctrl state, but we know for automation they probably want to integrate with the browser state.

As an alternative, we can try to specify the defaults within WebDriver in detail. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants